package homework013;

import java.io.IOException;
import java.util.concurrent.*;

public class Main2 {
    public static void main(String[] args) throws IOException {
        ExecutorService singleThreadPool = new ThreadPoolExecutor(2,
                2,
                0L,
                TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>(10),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());

        singleThreadPool.execute(new Server(8888));
        singleThreadPool.execute(new Send("127.0.0.1", 9999));
        singleThreadPool.shutdown();
    }
}
